vcRobotController

vcRobotController allows you control a robot and drive its joints. If you need realistic robot simulation, use vcRrsRobotController.

See in: Overview

Module: vcRobotics

Parent: vcServoController

Children -

Referenced by: vcRrsRobotController.InternalController

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
ApproachAxisvcApproachAxisRWDefines how to orient the robot based on the orientation of the active tool frame.
BasesvcList[vcBaseFrame]RGets a list of all base frames available in controller.
ConfigurationModevcMotionConfigurationModeRWDefines the configuration mode for joints driven by robot controller during linear motion interpolation.
See more
0 = Fixed
No change. That is, current configuration is used and does not change.

1 = Follow frame
Configuration closest to previous joint values is used.

2 = Interpolate joint values
Configuration is determined by point-to-point interpolation of joint values.
FlangeOffsetStringRWDefines an offset from flange node origin.
See more
Generally, this is used when flange node origin is not the exact place where to mount a tool or kinematics structure to end of robot arm.
KinematicsvcBehaviorRWDefines the kinematics object used by the controller which describes the robot's kinematic structure.
LagTimeRealRWIf linear motion, defines default lag time.
MaxAngularAccelRealRWIf linear motion, defines maximum acceleration for angular movement (degrees/s^2).
MaxAngularSpeedRealRWIf linear motion, defines maximum speed for angular movement (degrees/s).
MaxCartesianAccelRealRWIf linear motion, defines maximum acceleration for linear movement (mm/s^2).
MaxCartesianSpeedRealRWIf linear motion, defines maximum speed for linear movement (mm/s).
OrientationInterpolationModevcMatrixModeRWDefines the orientation interpolation mode for linear movement.
RootOffsetStringRWDefines an offset from root node origin, thereby defining the start of kinematics structure.
SettleTimeRealRWIf linear motion, defines default settle time.
ToolsvcList[vcToolFrame]RGets a list of all tool frames available in controller.
TrackWorldFrameModevcTrackWorldFrameRWDefines Robot World Frame (RWF) of robot when mounted on track.

0
Track origin is used as RWF.

1
RWF of robot is used as RWF.
WorldTransformMatrixvcMatrixRWDefines Robot World Frame of robot.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
addBasevcBaseFrameNoneAdds a new base frame to controller.

Returns:
vcBaseFrame: new base frame
addTargetNonevcMatrix matrix,
Optional Keyword[tmode = Integer]
Adds a given motion target or target matrix to robot target list.
See more
If target matrix, current settings of robot controller are used and an optional target_mode can be given to define how target relates to robot. This is similar to moveTo() method.

Generally, you use addTarget() when you are creating a batch of targets and the robot will use non-zero accuracy limits.

Parameters:
(target: vcMotionTarget) or
(matrix: vcMatrix, target_mode: vcMotionTargetMode (optional))
addTargetNonevcMotionTarget target-
addToolvcBaseFrameNoneAdds a new tool frame to controller.

Returns;
vcBaseFrame: new tool frame
clearTargetsNoneNoneRemoves all motion targets and target matrices from robot target list.
createMotionInterpolatorvcMotionInterpolatorNoneCreates a new motion interpolator for robot.

Returns:
vcMotionInterpolator: motion interpolator.
createTargetvcMotionTargetOptional Keyword[matrix = vcMatrix]Create a new motion target using current controller settings, and then returns the new motion target.
See more
An optional matrix argument can be given to define target matrix of target.

Parameters:
matrix: vcMatrix (optional)

Returns:
vcMotionTarget: created target.
moveobjectNoneMoves robot to all targets in robot target list.

Python execution will wait until robot has motioned to all previously added targets.
moveImmediateNonevcMatrix matrix,
Optional Keyword[tmode = Integer]
Moves robot to a given target immediately.

An optional target_mode argument can be given to define how target relates to robot.
See more
Parameters:
target: vcMotionTarget
target_mode: vcMotionTargetMode (optional)
moveImmediateNonevcMotionTarget target-
moveRelToobjectvcVector offset,
Optional Keyword[tmode = Integer]
Moves robot to a position relative to current robot pose using current controller settings.
See more
An optional target_mode argument can be given to define how target relates to robot.

Parameters:
(offset: vcVector, target_mode: vcMotionTargetMode)
(X: Real, y: Real, z:Real, target_mode: vcMotionTargetMode)
moveRelToobjectReal x,
Real y,
Real z,
Optional Keyword[tmode = Integer]
-
moveToobjectvcMatrix matrix,
Optional Keyword[tmode = Integer]
Moves robot to a given target or matrix, thereby clearing any previously added targets.
See more
An optional target_mode argument can be given to define how target relates to robot.

Parameters:
(target: vcMotionTarget)
(matrix: vcMatrix, target_mode: vcMotionTargetMode)
moveToobjectvcMotionTarget target-
removeBaseNonevcBaseFrame baseRemoves a given Base from controller.

Parameters:
Base (vcBaseFrame): Base to remove
removeToolNonevcBaseFrame toolRemoves a given Tool from controller.

Parameters:
Tool (vcBaseFrame): Tool to remove

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnPositionNoneTriggered when robot reaches a motion target in its robot target list.

Parameters:
robot: vcRobotController

Example: Move Robot

"""Move robot"""

import vcCore as vc
import vcBehaviors as vc_beh
import vcRobotics as vc_robo

app = vc.getApplication()
comp = vc.getComponent()


async def OnRun():
  """Move robot with vcRobotController"""
  ctr = comp.findBehavior(vc_beh.vcBehaviorType.ROBOT_CONTROLLER)
  ctr.clearTargets()
  
  # Create motion target and set it up
  motion_target = ctr.createTarget()
  motion_target.BaseName = ctr.Bases[0].Name
  motion_target.ToolName = ctr.Tools[0].Name
  motion_target.JointValues = [x.CurrentValue for x in ctr.Joints]
  motion_target.RobotConfig = 0
  
  # Create target matrix
  target_matrix = vc.vcMatrix.new()
  target_matrix.P = vc.vcVector.new(800.0, -200.0, 600.0)
  target_matrix.WPR = vc.vcVector.new(0.0, 180.0, 0.0)
  
  # Add first motion as PTP
  motion_target.MotionType = vc_robo.vcMotionType.JOINT
  motion_target.Target = target_matrix
  motion_target.JointSpeedFactor = 1.0
  ctr.addTarget(motion_target)
  
  # Reuse motion target object for next motions, just change motion type and target matrix
  motion_target.MotionType = vc_robo.vcMotionType.LINEAR
  motion_target.CartesianSpeed = 200.0
  target_matrix.P = vc.vcVector.new(1200.0, -200.0, 600.0)
  motion_target.Target = target_matrix
  ctr.addTarget(motion_target)
  target_matrix.P = vc.vcVector.new(1200.0, 200.0, 600.0)
  motion_target.Target = target_matrix
  ctr.addTarget(motion_target)
  target_matrix.P = vc.vcVector.new(800.0, 200.0, 600.0)
  motion_target.Target = target_matrix
  ctr.addTarget(motion_target)
  target_matrix.P = vc.vcVector.new(800.0, -200.0, 600.0)
  motion_target.Target = target_matrix
  ctr.addTarget(motion_target)
  
  # Move robot through all targets
  await ctr.move()